package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.RewardVO;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/5/17 10:58
 * 修改备注：
 * ================================================
 */
public class RewardHolder extends BaseViewHolder<RewardVO> {

    private TextView tvCoin;

    public RewardHolder(ViewGroup parent) {
        super(parent, R.layout.item_reward);
        tvCoin = $(R.id.tv_coin);
    }

    @Override
    public void setData(RewardVO data) {
        super.setData(data);
        tvCoin.setText(data.getDescribe());
        if (data.isSelected()) {
            tvCoin.setTextColor(getContext().getResources().getColor(R.color.app_color));
            tvCoin.setBackgroundResource(R.drawable.bg_reward_select);
        } else {
            tvCoin.setBackgroundResource(R.drawable.shape_bt_gray_line);
            tvCoin.setTextColor(getContext().getResources().getColor(R.color.colorGray));
        }

    }
}
